#!/bin/bash

function compileIPA() {
	curDate=$1
	mode=$2
	
	dir=~/Downloads/build/$curDate
	mkdir -p $dir
	echo 创建目录$dir
	objectName=OCAPPDemo
	ipaName=${objectName}${mode}.ipa
	archPath=$dir/${objectName}.xcarchive

	# xcodebuild -workspace ${objectName}.xcworkspace -scheme $objectName -configuration Release -archivePath $archPath archive
    xcodebuild -exportArchive -archivePath /Users/os/Downloads/build/20210926_2058/OCAPPDemo.xcarchive -exportPath $dir/${objectName}_Dev -exportOptionsPlist ExportOptions/exportOptionsDev.plist
}

# pod update
# xcodebuild clean
date="`date +%Y%m%d_%H%M`"
compileIPA $date _Release  